import {cardCache} from 'nc-lightapp-front';
import { DOCLIST } from '../../../../common/constant';
import { fiterFrkm, fiterLrzxOrg } from '../../../../common/util/fiterUtils';
let { getDefData } = cardCache;

/*
 * @Author: nccloud
 * @PageInfo: 表头编辑前
 */
export default async function(props, moduleId, key, value, oldvalue, refinfo) {
        if(key == 'vdef5' ){
            fiterLrzxOrg(props, moduleId, key, true, false);
        }else if(key == 'headacc'){
            let pk_org = props.form.getFormItemsValue('card_head', 'pk_org').value;
            let pk_accountingbook = getDefData("txaccbook","txaccbook");
            let fiterType = DOCLIST.txdjdf;
            fiterFrkm(props, moduleId, key, pk_org, pk_accountingbook, fiterType);
        }
        
        return true;
}
